package com.rd.student.dashuju.sunwenzhuo.Test2;


import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入金字塔的层数");
        int num = scanner.nextInt();

        for (int i = 1; i < num + 1; i++) {//外层循环次数

            for (int k = 0; k < num-i; k++) {
                //打印空格
                System.out.print(" ");

            }
            for (int j = 0; j < 2*i-1; j++) {

                System.out.print("*");

            }

            System.out.println();

        }
    }
}

